********************************************************************************
*																			   *
*						Sir! I'd Rather Go to School Sir!					   *
*																			   *
*								 Mahdi Majbouri								   *
*																			   *
*									 Table B5								   *
*																			   *
*									6-6-2023								   *
*																			   *
********************************************************************************


********************
** Job Status
********************

use "census11-all.dta", clear

keep if fage>=fage18 & fage18>=threshold - 9 & fage18<=threshold + 10
keep if urban == 2

replace occ = . if occ>=998
gen job = int(occ/100) if occ>=100

/*
gen cskill = (job == 9)
replace cskill = 2 if inlist(job, 8, 7, 6, 5)
replace cskill = 3 if inlist(job, 3, 4)
replace cskill = 4 if job == 2
replace cskill = 4 if job == 1
replace cskill = . if job == . 
*/
gen cskill = inlist(job, 1, 2, 3, 4) if job !=.

gen s = (sons==1 & son==1) if sons!=.
replace s = . if relate == 3 & son == 0

gen st = s * t
gen sfa = s * fa
gen stfa = s * t * fa

gen sfasq = s * fasq
gen stfasq = s * t * fasq

gen sfacb = s * facb
gen stfacb = s * t * facb

gen dfa = sfa
replace dfa = 100 *fa if s == 0

drop if school == 1

gen agesq = age * age / 100

gen lfp = (empstat == 1 | empstat == 2)	if empstat != .	
reg lfp college_plus if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("LFP(OLS)") replace
ivreg2 lfp (college_plus = st) t fa tfa s sfa ///
		stfa if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("LFP(1)") append
ivreg2 lfp (college_plus = st) t fa tfa fasq tfasq s sfa ///
		stfa sfasq stfasq if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust		
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("LFP(2)") append
ivreg2 lfp (college_plus = st) t fa tfa fasq tfasq facb tfacb s sfa ///
		stfa sfasq stfasq sfacb stfacb if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust		
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("LFP(3)") append
		
gen unemployed = (empstat == 2) if lfp == 1		
reg unemployed college_plus if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("UNEMP(OLS)") append
ivreg2 unemployed (college_plus = st) t fa tfa s sfa ///
		stfa if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("UNEMP(1)") append
ivreg2 unemployed (college_plus = st) t fa tfa fasq tfasq s sfa ///
		stfa sfasq stfasq if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust		
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("UNEMP(2)") append
ivreg2 unemployed (college_plus = st) t fa tfa fasq tfasq facb tfacb s sfa ///
		stfa sfasq stfasq sfacb stfacb if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust		
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("UNEMP(3)") append
		
		
reg cskill college_plus if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("SKILL(OLS)") append
ivreg2 cskill (college_plus = st) t fa tfa s sfa ///
		stfa if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust		
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("SKILL(1)") append

ivreg2 cskill (college_plus = st) t fa tfa fasq tfasq s sfa ///
		stfa sfasq stfasq if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust		
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("SKILL(2)") append

ivreg2	cskill (college_plus = st) t fa tfa fasq tfasq s sfa ///
		stfa sfasq stfasq sfacb stfacb if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust		
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("SKILL(3)") append


		
/*
gen av_w = 11.79569 if job == 1
replace av_w = 11.81778 if job == 2
replace av_w = 11.49667 if job  == 3
replace av_w = 11.45292 if job == 4
replace av_w = 11.02354 if job == 5
replace av_w = 11.15699 if job == 6
replace av_w = 11.13624 if job == 7
replace av_w = 11.27502 if job == 8
replace av_w = 11.1698 if job == 9
*replace av_w = 11.88556 if status == 0	
*/
gen av_w = 10.331495 if job == 1
replace av_w = 10.085716 if job == 2
replace av_w = 9.7432507 if job  == 3
replace av_w = 9.7092485 if job == 4
replace av_w = 9.4013557 if job == 5
replace av_w = 9.4451785 if job == 6
replace av_w = 9.5111654 if job == 7
replace av_w = 9.5588096 if job == 8
replace av_w = 9.4004441 if job == 9

reg av_w college_plus if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("grossmonthlywage(OLS)") append
ivreg2 av_w (college_plus = st) t fa tfa s sfa ///
		stfa if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust		
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("grossmonthlywage(1)") append
ivreg2 av_w (college_plus = st) t fa tfa fasq tfasq s sfa ///
		stfa sfasq stfasq if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust		
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("grossmonthlywage(2)") append
ivreg2 av_w (college_plus = st) t fa tfa fasq tfasq facb tfacb s sfa ///
		stfa sfasq stfasq sfacb stfacb if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, robust		
outreg2 using "Table B5", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) adds(F-test, e(widstat)) ctitle("grossmonthlywage(3)") append

		


********************************************************************************
*********************************  THE END *************************************
********************************************************************************
	
